Thursday, December 07, 2006

Les Smith .NET Blog

I just posted a rather lengthy article on extending the functionality of the CodeModel or better yet, the FileCodeModel. In spite of the functionality that it has, it still lacks functionality and this article shows some neat tricks for finding and retrieveing code that the CodeModel cannot do.

I think you will find some help here, if you are interested in the CodeModel, Regexes, and extensibility in general. Hope you like it.

The link is

http://www.knowdotnet.com/articles/extendingthecodemodel.html

Take a look.

9 Comments:

At 10:10 AM, Blogger DZ said...

Les, good stuff. It appears the regex and "Type" are for VB.Net. Did I read the blog correctly?

Secondly, is a request/guidance to... the ability for the an add-in to identify when the project was running in debug, the debugger hit a breakpoint and the add-in (with maybe the user placing the cursor on the breakpoint line) able to use regex and possibly reflection on the line of the breakpoint to extract type information. Do you know, or where to point me.

thanks,

/DZ
Little Rock, AR. USA

 
At 10:11 AM, Blogger DZ said...

Les, good stuff. It appears the regex and "Type" are for VB.Net. Did I read the blog correctly?

Secondly, is a request/guidance to... the ability for the an add-in to identify when the project was running in debug, the debugger hit a breakpoint and the add-in (with maybe the user placing the cursor on the breakpoint line) able to use regex and possibly reflection on the line of the breakpoint to extract type information. Do you know, or where to point me.

 
At 11:47 AM, Blogger Les Smith said...

DZ
I just looked back at the article. Since there is no group name of "type" in the regex, therefore my example code is not right.

Please check the site again, as I have updated the article.

Thanks for asking about it. No one ever pointed it out before. The code, from which I extracted has been corrrected. Also I just found a bug in the regex a couple of days ago so the regex should be changed also. Again, check the updated article.

It must be that way (change from \w+ to .*) to pick up something like Implements Class.Test. The former version of the regex does not pick up .Test.


Regarding the second question, I am afraid I can't help you.



Thanks

Les

 
At 7:09 AM, Blogger nava said...

Hi Les,
Please help me.
My question is as follows:
I'm planning to develop an application using vb.net and sql server 2000. However, I just want to create a connection class which is used to connect all forms with a database. As the application is not hard coded, control objects like checked list box will connect and retrieve data from the database. How can I create this connection class? Please help!
Please...Please...

 
At 6:11 PM, Blogger Les Smith said...

Nava,
I am not sure how to answer you so write a note to bill@knowdotnet.com, one of our partners. If he does not pick up the email, try brian@knowdotnet.com.

They can probably help you better than I can on this subject of data binding.

 
At 1:10 PM, Blogger Unknown said...

Les,

How about using:
dateadd(wk,datediff(wk,7,getdate()),0)
for last Monday...and:
dateadd(wk,datediff(wk,7,getdate()),6)
for the following Sunday.

This way you can "plug" these right into your SQL function/procedure.

 
At 4:40 PM, Blogger Unknown said...

That was very informative. I am looking to write a code model for a custom javascript architecture. Unfortunately, I can not find any information on building one from the ground up. I would appreciate any assitance you can offer.

Thank you,
Nathan

 
At 12:31 PM, Blogger Unknown said...

I couldn't find a better place for this, so here goes:

On inputbox.html you give a way to create a input box in c#. There's a much better way -- just reference the Microsoft.VisualBasic dll from within your C# program and you then use the VB InputBox like so:
Microsoft.VisualBasic.Interaction.InputBox("Prompt", "Title", "default", 200, 200);

Lot's easier...

 
At 12:15 PM, Blogger Les Smith said...

J.
I cannot disagree with you. However, most C# developers that have never done VB.NET would not think of making a reference to Microsoft.VisualBasic.

I think that kind of think is commonly knowm as "cutting off your nose to spited your face", but that't the way it is. Since I have 12 years of VB-VB.Net experience in addition to several years of C#, I personally think that VB is much more developer friendly but then I like and appreciate much of C#.

Thanks for the tip.

Les

 

Post a Comment

<< Home